<template>
  <div class="logo" :style="{ background: primaryColor }" @click="refresh">
    <router-link :to="{ name: '/' }">
      <!-- <img src="~@/assets/logo.svg" alt="logo" /> -->
      <h1 v-if="showTitle" style="color: white">{{ title }}</h1>
    </router-link>
  </div>
</template>

<script>
  export default {
    name: 'Logo',
    components: {},
    props: {
      primaryColor: {
        type: String,
        required: true,
      },
      title: {
        type: String,
        default: '海南省水务建设市场信用信息平台',
        required: false,
      },
      showTitle: {
        type: Boolean,
        default: true,
        required: false,
      },
    },
    methods: {
      refresh() {
        this.$router.go(0)
      },
    },
  }
</script>
